﻿using Cms.Core.Application.Secutiry.Base;
using Cms.Core.Infrastructure.Dependency;
using System;
using System.Collections.Generic;
using System.Text;
using System.Threading.Tasks;

namespace Cms.Core.Application.Secutiry.Token
{
    public interface IOnlineTokenCache :ISingletonDependency
    {

        /// <summary>
        /// 
        /// </summary>
        /// <param name="userId"></param>
        /// <param name="token"></param>
        /// <param name="expirationTime"></param>
        /// <returns></returns>
        OnlineToken GetOrRefresh(Guid userId, string token, DateTime expirationTime);


        /// <summary>
        /// 
        /// </summary>
        /// <param name="userId"></param>
        /// <param name="token"></param>
        /// <param name="expirationTime"></param>
        /// <returns></returns>
        Task<OnlineToken> GetOrRefreshAsync(Guid userId, string token, DateTime expirationTime);


        /// <summary>
        /// 
        /// </summary>
        /// <param name="token"></param>
        /// <returns></returns>
        Task<OnlineToken> GetAsync(string token);


        /// <summary>
        /// 
        /// </summary>
        /// <param name="key"></param>
        void Remove(string key);


    }
}
